import service from "@/utils/request";

export const sysMenu = ()=>{
    return service({
        url:"/sys/permission/menu",
        method:"get"
    })
};

export const sysUser = (params)=>{
    return service({
        url:"/sys/user",
        method:"get",
        params
    })
};

export const sysDepartments = ()=>{
    return service({
        url:"/sys/department",
        method:"get"
    })
};

export const sysUserInfo = ()=>{
    return service({
        url:"/sys/user/info",
        method:"get"
    })
};

export const sysLogin = (data)=>{
    return service({
        url:"/sys/user/login",
        method:"post",
        data
    })
};

export const sysRoles = ()=>{
    return service({
        url:"/sys/role",
        method:"get"
    })
}; 

export const sysPermission = (roleId)=>{
    return service({
        url:"/sys/permission/findByRoleId",
        method:"get",
        params:{
            roleId
        }
    })
}; 

export const sysPermissionCheck = (data)=>{
    return service({
        url:"/sys/permission/check",
        method:"post",
        data
    })
};
export const sysPermissionCheckParent = (data)=>{
    return service({
        url:"/sys/permission/check/parent",
        method:"post",
        data
    })
};